package adv7.bank2;

public class Saver extends Thread {
	private Account ac;

	public Saver(Account ac, String name) {
		super(name);
		this.ac = ac;
	}

	@Override
	public void run() {
		while (true) {
			try {
				sleep(1000);
				ac.deposit(2500);
				synchronized (ac) {
					ac.notifyAll();// 通知
				}

			} catch (InterruptedException e) {
				// TODO 自动生成的 catch 块
				e.printStackTrace();
			}

		}
	}
}
